<!DOCTYPE html>
<html lang="zh-CN">
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>配置管理 - Powered by MinDoc</title>
    <link th:href="@{/bootstrap/css/bootstrap.min.css}" rel="stylesheet">
    <link th:href="@{/font-awesome/css/font-awesome.min.css}" rel="stylesheet">
    <link th:href="@{/css/main.css}" rel="stylesheet">
</head>
<body>
<div class="manual-reader">
    <div th:replace="/widgets/header :: header"></div>
    <div class="container manual-body">
        <div class="row">
            <div class="page-left">
                <ul class="menu">
                    <li><a href="" class="item"><i class="fa fa-dashboard" aria-hidden="true"></i> 仪表盘</a> </li>
                    <li><a href="users" class="item"><i class="fa fa-users" aria-hidden="true"></i> 用户管理</a> </li>
                    <li><a href="books" class="item"><i class="fa fa-book" aria-hidden="true"></i> 项目管理</a> </li>
                    <li class="active"><a href="setting" class="item"><i class="fa fa-cogs" aria-hidden="true"></i> 配置管理</a> </li>
                    <li><a href="attach/list" class="item"><i class="fa fa-cloud-upload" aria-hidden="true"></i> 附件管理</a> </li>
                </ul>
            </div>
            <div class="page-right">
                <div class="m-box">
                    <div class="box-head">
                        <strong class="box-title" > 配置管理</strong>
                    </div>
                </div>
                <div class="box-body">
                    <form method="post" id="gloablEditForm" action="/manager/setting">
                            <div class="form-group">
                                <label>网站标题</label>
                                <input type="text" class="form-control" name="SITE_NAME" id="siteName" placeholder="网站标题" th:value="${SITE_NAME}">
                            </div>
                            <div class="form-group">
                                <label>启用匿名访问</label>
                                <div class="radio" th:switch="${ENABLE_ANONYMOUS}">
	                                <p th:case="'true'">
	                                   <label class="radio-inline">
                                        <input type="radio"   checked name="ENABLE_ANONYMOUS" value="true">开启<span class="text"></span>
	                                    </label>
	                                    <label class="radio-inline">
	                                        <input type="radio"   name="ENABLE_ANONYMOUS" value="false">关闭<span class="text"></span>
	                                    </label>
	                                </p>
	                                <p th:case="'false'">
	                                   <label class="radio-inline">
                                        <input type="radio"    name="ENABLE_ANONYMOUS" value="true">开启<span class="text"></span>
	                                    </label>
	                                    <label class="radio-inline">
	                                        <input type="radio"   name="ENABLE_ANONYMOUS" value="false">关闭<span class="text"></span>
	                                    </label>
	                                </p>
                                </div>
                            </div>
                        <div class="form-group">
                            <label>启用注册</label>
                            <div class="radio" th:switch="${ENABLED_REGISTER}">
                               <p th:case="'true'">
	                                <label class="radio-inline">
	                                    <input type="radio"  checked  name="ENABLED_REGISTER" value="true">开启<span class="text"></span>
	                                </label>
	                                <label class="radio-inline">
	                                    <input type="radio"  name="ENABLED_REGISTER" value="false">关闭<span class="text"></span>
	                                </label>
                                </p>
                                <p th:case="'false'">
	                                <label class="radio-inline">
	                                    <input type="radio"  name="ENABLED_REGISTER" value="true">开启<span class="text"></span>
	                                </label>
	                                <label class="radio-inline">
	                                    <input type="radio"  checked  name="ENABLED_REGISTER" value="false">关闭<span class="text"></span>
	                                </label>
                                </p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label>启用验证码</label>
                            <div class="radio" th:switch="${ENABLED_REGISTER}">
                               <p th:case="'true'">
	                                <label class="radio-inline">
	                                    <input type="radio"  checked  name="ENABLED_CAPTCHA" value="true">开启<span class="text"></span>
	                                </label>
	                                <label class="radio-inline">
	                                    <input type="radio"  name="ENABLED_CAPTCHA" value="false">关闭<span class="text"></span>
	                                </label>
                                 </p>
                                 <p th:case="'false'">
	                                <label class="radio-inline">
	                                    <input type="radio"   name="ENABLED_CAPTCHA" value="true">开启<span class="text"></span>
	                                </label>
	                                <label class="radio-inline">
	                                    <input type="radio"  checked name="ENABLED_CAPTCHA" value="false">关闭<span class="text"></span>
	                                </label>
                                 </p>
                            </div>
                        </div>
                        <div class="form-group">
                            <label>启用文档历史</label>
                            <div class="radio" th:switch="${ENABLE_DOCUMENT_HISTORY}">
                               <p th:case="'true'">
	                                <label class="radio-inline">
	                                    <input type="radio"   checked   name="ENABLE_DOCUMENT_HISTORY" value="true">开启<span class="text"></span>
	                                </label>
	                                <label class="radio-inline">
	                                    <input type="radio"   name="ENABLE_DOCUMENT_HISTORY" value="false">关闭<span class="text"></span>
	                                </label>
                                 </p>
                                 <p th:case="'true'">
	                                <label class="radio-inline">
	                                    <input type="radio"   name="ENABLE_DOCUMENT_HISTORY" value="true">开启<span class="text"></span>
	                                </label>
	                                <label class="radio-inline">
	                                    <input type="radio"   checked   name="ENABLE_DOCUMENT_HISTORY" value="false">关闭<span class="text"></span>
	                                </label>
                                 </p>
                            </div>
                        </div>
                        <div class="form-group">
                            <button type="submit" id="btnSaveBookInfo" class="btn btn-success" data-loading-text="保存中...">保存修改</button>
                            <span id="form-error-message" class="error-message"></span>
                        </div>
                        </form>

                    <div class="clearfix"></div>
                </div>
            </div>
        </div>
    </div>
    <div th:replace="/widgets/footer :: footer"></div>
</div>
<script th:src="@{/jquery/1.12.4/jquery.min.js}" type="text/javascript"></script>
<script th:src="@{/bootstrap/js/bootstrap.min.js}" type="text/javascript"></script>
<script th:src="@{/js/jquery.form.js}" type="text/javascript"></script>
<script th:src="@{/js/main.js}" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#gloablEditForm").ajaxForm({
            beforeSubmit : function () {
                var title = $.trim($("#siteName").val());

                if (title === ""){
                    return showError("网站标题不能为空");
                }
                $("#btnSaveBookInfo").button("loading");
            },success : function (res) {
                if(res.code === 0) {
                    showSuccess("保存成功")
                }else{
                    showError(res.msg);
                }
                $("#btnSaveBookInfo").button("reset");
            }
        });
    });
</script>
</body>
</html>